fix errors handling optional Waypoint fields. (#948)
* fix errors handling optional Waypoint fields.
1. Hide wp_flags from formats by using WAYPT_SET.
2. Don't print values corresponding to Waypoint fields that aren't
valid.
a) if the field uses wp_flags, then the flag must be set.
b) power, cadence heartrate must not be zero.
This is in anticipation of use of std::optional instead of wp_flags
to indicate an optional value is present.
The use of invalid power, cadence, and heartrate values was found
fortuitously.
Note this changes kml output, using empty gx:value elements to
correspond to missing data. gx:value elements are of type
string, the empty string do not violate the schema (unlike empty
when elements). However, it is unclear who is using this extra
SchemaData so we cannot check to make sure they acutally handle
empty string values.
* don't use WAYPT_HAS with wp_flags that aren't optionals.
* fix some bugs with our home grown optionals.
mostly not using WAYPT_SET resulting in the value being lost.
12 files changed: